<%@ page language="java" import="java.util.*"
	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>学生表</title>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<script type="text/javascript">
	//编写自定义JS代码
</script>
</head>
<body>
	<t:formvalid formid="formobj" dialog="true" usePlugin="password"
		layout="table" action="studentController.do?doUpdate">
		<input id="id" name="id" type="hidden" value="${studentPage.id }" />
		<fieldset>
			<legend>个人信息</legend>
			<table cellpadding="0" cellspacing="0">
				<tr>
					<td width=90%;>

						<table style="width: 90%;" cellpadding="0" cellspacing="1"
							class="formtable">
							<tr>
								<td align="right"><label class="Validform_label">
										学号: </label></td>
								<td class="value"><input id="stuNo" name="stuNo"
									type="text" maxlength="50" style="width: 150px" class="inputxt"
									validType="student,stu_no,id" 
									value='${studentPage.stuNo}' readonly="readonly"/> <span
									class="Validform_checktip"></span> <label
									class="Validform_label" style="display: none;">学号</label></td>
								<td align="right"><label class="Validform_label">
										学生姓名: </label></td>
								<td class="value"><input id="stuName" name="stuName"
									type="text" maxlength="100" style="width: 150px"
									 value='${studentPage.stuName}' readonly="readonly"/>
									<span class="Validform_checktip"></span> <label
									class="Validform_label" style="display: none;">学生姓名</label></td>
							</tr>
							<tr>
								<td align="right"><label class="Validform_label">
										性别: </label></td>
								<td class="value"><t:dictSelect field="sex" type="radio"
										datatype="n" typeGroupCode="stu_sex" readonly="readonly"
										defaultVal="${studentPage.sex}" hasLabel="false" title="性别"></t:dictSelect>
									<span class="Validform_checktip"></span> <label
									class="Validform_label" style="display: none;">性别</label></td>
								<td align="right"><label class="Validform_label">
										出生日期: </label></td>
								<td class="value"><input id="birth" name="birth"
									type="text" style="width: 150px" class="Wdate"
									onClick="WdatePicker()" ignore="ignore" readonly="readonly"
									value='<fmt:formatDate value='${studentPage.birth}' type="date" pattern="yyyy-MM-dd"/>' />
									<span class="Validform_checktip"></span> <label
									class="Validform_label" style="display: none;">出生日期</label></td>
							</tr>
							<tr>
								<td align="right"><label class="Validform_label">
										身份证号码: </label></td>
								<td class="value"><input id="cardCode" name="cardCode"
									type="text" maxlength="30" style="width: 150px" class="inputxt"
									ignore="ignore" value='${studentPage.cardCode}'readonly="readonly" /> <span
									class="Validform_checktip"></span> <label
									class="Validform_label" style="display: none;">身份证号码</label></td>
								<td align="right"><label class="Validform_label">
										手机号码: </label></td>
								<td class="value"><input id="telphone" name="telphone"
									type="text" maxlength="20" style="width: 150px" class="inputxt"
									datatype="m" ignore="ignore" value='${studentPage.telphone}' />
									<span class="Validform_checktip"></span> <label
									class="Validform_label" style="display: none;">手机号码</label></td>
							</tr>
							<tr>
								<td align="right"><label class="Validform_label">
										家庭住址: </label></td>
								<td class="value"><input id="address" name="address"
									type="text" maxlength="100" style="width: 150px"
									class="inputxt" ignore="ignore" value='${studentPage.address}' />
									<span class="Validform_checktip"></span> <label
									class="Validform_label" style="display: none;">家庭住址</label></td>
								<td align="right"><label class="Validform_label">
										户口所在地: </label></td>
								<td class="value"><input id="huKou" name="huKou"
									type="text" maxlength="100" style="width: 150px"
									class="inputxt" ignore="ignore" value='${studentPage.huKou}' />
									<span class="Validform_checktip"></span> <label
									class="Validform_label" style="display: none;">户口所在地</label></td>
							</tr>
							<tr>
								<td align="right"><label class="Validform_label">
										电子邮箱地址: </label></td>
								<td class="value"><input id="email" name="email"
									type="text" maxlength="50" style="width: 150px" class="inputxt"
									datatype="e" ignore="ignore" value='${studentPage.email}' /> <span
									class="Validform_checktip"></span> <label
									class="Validform_label" style="display: none;">电子邮箱地址</label></td>
								<td class="value"></td>
								<td class="value"></td>
							</tr>
							<tr>
								<td align="right"><label class="Validform_label">
										班级名称: </label></td>
								<td class="value"><span>${gradePage.gradeName}</span></td>
								<td align="right"><label class="Validform_label">
										班主任: </label></td>
								<td class="value"><span>${teacherPage.teacherName}</span></td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</fieldset>
	</t:formvalid>
	<div class="easyui-layout" fit="true">
		<div region="center" style="padding: 0px; border: 0px">
			<t:datagrid name="" pagination="true"
				fitColumns="true" title="" sortName="" actionUrl="" idField="">
				<t:dgToolBar title="修改" icon="icon-edit" funname="updateInfo"></t:dgToolBar>
				<t:dgToolBar title="取消" icon="icon-remove" funname="cancel"></t:dgToolBar>
			</t:datagrid>
		</div>
	</div>
	<script type="text/javascript">
		function updateInfo(){

			var form=$("#formobj").Validform();
			$.ajax({
				url:"studentController.do?doUpdate",
				data:$("#formobj").serialize(),
				success : function(result){
					var d = JSON.parse(result);
					var icon = d.success == true?1:2;
					layer.open({
						title:$.i18n.prop('tip.title'),
						offset:'rb',
						content:d.msg,
						time:6000,
						btn:false,
						shade:false,
						icon:icon,
						skin:'jz',

						shift:2
					});
				}
			})
			//form.submitForm(true);
		}
		
		function cancel(){
			location.reload();
		}
	</script>
</body>
</html>